//
//  ThreeLabelTableViewCell.m
//  UI_APP_Project_Bean
//
//  Created by dllo on 16/6/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ThreeLabelTableViewCell.h"
#import "CinemalistModel.h"

@interface ThreeLabelTableViewCell ()

@property(nonatomic, retain)UILabel *titleLabel;
@property(nonatomic, retain)UILabel *addressLabel;
@property(nonatomic, retain)UILabel *teleLabel;

@property(nonatomic, retain)UIImageView *back;


@end




@implementation ThreeLabelTableViewCell
-(void)dealloc{
    [_cinemaModel release];
    [_titleLabel release];
    [_addressLabel release];
    [_teleLabel release];
    [super dealloc];
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
       self.back = [[UIImageView alloc]init];
        [self.contentView addSubview:_back];
        [_back release];
        self.titleLabel = [[UILabel alloc]init];
        [_back addSubview:_titleLabel];
        [_titleLabel release];
        
        self.addressLabel = [[UILabel alloc]init];
        [_back addSubview:_addressLabel];
        [_addressLabel release];
        
        self.teleLabel = [[UILabel alloc]init];
        [_back addSubview:_teleLabel];
        [_titleLabel release];
        
    }
    
    return self;
}

-(void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.back.frame = CGRectMake(10, 10, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 27);
    self.back.image = [UIImage imageNamed:@"bg_eventlistcell.png"];
    
    self.titleLabel.frame = CGRectMake(15, 10, self.back.frame.size.width-30, 25);
    self.titleLabel.font = [UIFont systemFontOfSize:25];
    
    
    self.addressLabel.frame = CGRectMake(15, _titleLabel.frame.size.height + 20, _titleLabel.frame.size.width, _titleLabel.frame.size.height);
    
    
    self.teleLabel.frame = CGRectMake(_addressLabel.frame.origin.x, _addressLabel.frame.origin.y + 40, _addressLabel.frame.size.width, _addressLabel.frame.size.height);
    
    
    
}


-(void)setCinemaModel:(CinemalistModel *)cinemaModel{
    
    if (_cinemaModel != cinemaModel) {
        [_cinemaModel release];
        _cinemaModel = [cinemaModel retain];
    }
    
    self.titleLabel.text = cinemaModel.cinemaName;
    
    self.addressLabel.text = cinemaModel.address;
    
    self.teleLabel.text = cinemaModel.telephone;
    
    
    
}












@end
